package com.yaodian100.ec.product.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 馆长推荐商品
 * 
 * @author aaron.chueh
 * 
 */
@Entity
@Table(name = "EC_PROD_CAT_SE")
public class ProdCatSE implements Comparable<ProdCatSE> {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3832314215896725137L;

	@Id
	@GeneratedValue(generator = "gen_uuid")
	@GenericGenerator(name = "gen_uuid", strategy = "uuid")
	@Column(name = "ID", length = 32)
	private String id;

	@Column(name = "SORT_ORDER")
	private Integer sortOrder;

	@ManyToOne
	@JoinColumn(name = "PRODUCT_ID")
	private Product product;

	@Column(name = "CATEGORY_ID")
	private Long categoryId;

	@Column(name = "SORT_WEIGHT")
	private Integer sortWeight;

	@Column(name = "CATEGORY_PATH", length = 100)
	private String categoryPath;
	@Column(name = "PROD_CAT_ID")
	private Long prodCatId;

	/**
	 * @return the prodCatId
	 */
	public Long getProdCatId() {
		return prodCatId;
	}

	/**
	 * @param prodCatId the prodCatId to set
	 */
	public void setProdCatId(Long prodCatId) {
		this.prodCatId = prodCatId;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Integer getSortOrder() {
		return sortOrder;
	}

	public void setSortOrder(Integer sortOrder) {
		this.sortOrder = sortOrder;
	}

	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	public Integer getSortWeight() {
		return sortWeight;
	}

	public void setSortWeight(Integer sortWeight) {
		this.sortWeight = sortWeight;
	}

	public String getCategoryPath() {
		return categoryPath;
	}

	public void setCategoryPath(String categoryPath) {
		this.categoryPath = categoryPath;
	}

	public int compareTo(ProdCatSE o) {
		return (this.sortWeight) - (o.sortWeight);
	}
}